package com.ittest.service.impl.kafka.listener;


import org.apache.kafka.clients.consumer.ConsumerRecord;
import org.springframework.kafka.annotation.KafkaListener;
import org.springframework.stereotype.Component;

import java.util.function.Consumer;

@Component
public class MessageListener {


    @KafkaListener(topics = "ittest")
    public void onMessage(ConsumerRecord<String,String> record){
        System.out.println("这是kafka的消费者，监听的是ittest这个topic（生产者）"+record.value());
    }
}
